<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0,maximum-scale=1.0, user-scalable=0">

    <title>订单管理</title>

    <link href="AmazeUI-2.4.2/assets/css/admin.css" rel="stylesheet" type="text/css">
    <link href="AmazeUI-2.4.2/assets/css/amazeui.css" rel="stylesheet" type="text/css">

    <link href="css/personal.css" rel="stylesheet" type="text/css">
    <link href="css/orstyle.css" rel="stylesheet" type="text/css">

    <script src="AmazeUI-2.4.2/assets/js/jquery.min.js"></script>
    <script src="AmazeUI-2.4.2/assets/js/amazeui.js"></script>
    <!--自定义工具-->
    <script src="js/HttpUtil.js"></script>
    <!--导入vue 包-->
    <script src="https://cdn.jsdelivr.net/npm/vue"></script>
    <script src="js/Data.js"></script>
    <script src="js/jquery.js"></script>
</head>

<body>
<!--头 -->
<header>
    <article>
        <div class="mt-logo">
            <!--顶部导航条 -->
            <div class="am-container header">
                <ul class="message-l">
                    <div class="topMessage">
                        <div class="menu-hd">
                            <a href="#" target="_top" class="h">亲，请登录</a>
                            <a href="#" target="_top">免费注册</a>
                        </div>
                    </div>
                </ul>
                <ul class="message-r">
                    <div class="topMessage home">
                        <div class="menu-hd"><a href="#" target="_top" class="h">商城首页</a></div>
                    </div>
                    <div class="topMessage my-shangcheng">
                        <div class="menu-hd MyShangcheng"><a href="#" target="_top"><i
                                class="am-icon-user am-icon-fw"></i>个人中心</a></div>
                    </div>
                    <div class="topMessage mini-cart">
                        <div class="menu-hd"><a id="mc-menu-hd" href="#" target="_top"><i
                                class="am-icon-shopping-cart  am-icon-fw"></i><span>购物车</span><strong id="J_MiniCartNum"
                                                                                                      class="h">0</strong></a>
                        </div>
                    </div>
                    <div class="topMessage favorite">
                        <div class="menu-hd"><a href="#" target="_top"><i
                                class="am-icon-heart am-icon-fw"></i><span>收藏夹</span></a></div>
                    </div>
                </ul>
            </div>

            <!--悬浮搜索框-->

            <div class="nav white">
                <div class="logoBig">
                    <li><img src="images/logobig.png"/></li>
                </div>

                <div class="search-bar pr">
                    <a name="index_none_header_sysc" href="#"></a>
                    <form>
                        <input id="searchInput" name="index_none_header_sysc" type="text" placeholder="搜索"
                               autocomplete="off">
                        <input id="ai-topsearch" class="submit am-btn" value="搜索" index="1" type="submit">
                    </form>
                </div>
            </div>

            <div class="clear"></div>
        </div>
        </div>
    </article>
</header>
<div class="nav-table">
    <div class="long-title"><span class="all-goods">全部分类</span></div>
    <div class="nav-cont">
        <ul>
            <li class="index"><a href="#">首页</a></li>
            <li class="qc"><a href="#">闪购</a></li>
            <li class="qc"><a href="#">限时抢</a></li>
            <li class="qc"><a href="#">团购</a></li>
            <li class="qc last"><a href="#">大包装</a></li>
        </ul>
        <div class="nav-extra">
            <i class="am-icon-user-secret am-icon-md nav-user"></i><b></b>我的福利
            <i class="am-icon-angle-right" style="padding-left: 10px;"></i>
        </div>
    </div>
</div>
<b class="line"></b>
<div class="center">
    <div class="col-main">
        <div class="main-wrap">

            <div class="user-order" id="div_vue">

                <!--标题 -->
                <div class="am-cf am-padding">
                    <div class="am-fl am-cf"><strong class="am-text-danger am-text-lg">订单管理</strong> /
                        <small>Order</small></div>
                </div>
                <hr/>

                <div class="am-tabs am-tabs-d2 am-margin" data-am-tabs>

                    <ul class="am-avg-sm-5 am-tabs-nav am-nav am-nav-tabs">
                        <li class="am-active" id="LiNum00" @click="displayList"><a href="#tab1">所有订单</a></li>
                        <li @click="payment(1)" id="LiNum01"><a href="#tab2">待付款</a></li>
                        <li @click="payment(2)" id="LiNum02"><a href="#tab3">待发货</a></li>
                        <li @click="payment(3)" id="LiNum03"><a href="#tab4">待收货</a></li>
                        <li @click="payment(4)" id="LiNum04"><a href="#tab5">待评价</a></li>
                    </ul>

                    <div class="am-tabs-bd">
                        <div class="am-tab-panel am-fade am-in am-active" id="tab1">
                            <div class="order-top">
                                <div class="th th-item">
                                    <td class="td-inner">商品</td>
                                </div>
                                <div class="th th-price">
                                    <td class="td-inner">单价</td>
                                </div>
                                <div class="th th-number">
                                    <td class="td-inner">数量</td>
                                </div>
                                <div class="th th-operation">
                                    <td class="td-inner">商品操作</td>
                                </div>
                                <div class="th th-amount">
                                    <td class="td-inner">合计</td>
                                </div>
                                <div class="th th-status">
                                    <td class="td-inner">交易状态</td>
                                </div>
                                <div class="th th-change">
                                    <td class="td-inner">交易操作</td>
                                </div>
                            </div>

                            <div class="order-main">
                                <div class="order-list" v-for="orders in orderList">
                                    <!--交易成功-->
                                    <div class="order-status5">
                                        <div class="order-title">
                                            <div class="dd-num">订单编号：<a href="javascript:;">{{orders.id}}</a></div>
                                            <span>成交时间：{{orders.createDate | formatDate}}</span>
                                        </div>
                                        <div class="order-content">
                                            <div class="order-left">
                                                <ul class="item-list" v-for="goods in orders.goodsList">
                                                    <li class="td td-item">
                                                        <div class="item-pic">
                                                            <a href="#" class="J_MakePoint">
                                                                <img :src="goods.imgUrl" class="itempic J_ItemImg">
                                                            </a>
                                                        </div>
                                                        <div class="item-info">
                                                            <div class="item-basic-info">
                                                                <a href="#">
                                                                    <p>{{goods.goodsName}}</p>
                                                                </a>
                                                            </div>
                                                        </div>
                                                    </li>
                                                    <li class="td td-price">
                                                        <div class="item-price">
                                                            ￥{{goods.price}}
                                                        </div>
                                                    </li>
                                                    <li class="td td-number">
                                                        <div class="item-number">
                                                            <span>×</span>{{goods.goodsNumber}}
                                                        </div>
                                                    </li>
                                                    <li class="td td-operation">
                                                        <div class="item-operation">

                                                        </div>
                                                    </li>
                                                </ul>
                                                <li class="td td-operation">
                                                    <div class="item-operation">

                                                    </div>
                                                </li>
                                                </ul>
                                            </div>
                                            <div class="order-right">
                                                <li class="td td-amount">
                                                    <div class="item-amount">
                                                        {{orders.orderPrice | showPrice}}
                                                    </div>
                                                </li>
                                                <div class="move-right">
                                                    <li class="td td-status">
                                                        <div>
                                                            <strong>{{orders.status | showStatus}}</strong>
                                                        </div>
                                                    </li>
                                                    <li class="td td-change">
                                                        <div class="am-btn am-btn-danger anniu" @click="deleteOrder(orders.id,orders.status)">
                                                            删除订单
                                                        </div>
                                                    </li>
                                                </div>
                                            </div>
                                        </div>
                                    </div>

                                </div>

                            </div>

                        </div>
                        <!--								代发货-->
                        <div class="am-tab-panel am-fade" id="tab2">

                            <div class="order-top">
                                <div class="th th-item">
                                    <td class="td-inner">商品</td>
                                </div>
                                <div class="th th-price">
                                    <td class="td-inner">单价</td>
                                </div>
                                <div class="th th-number">
                                    <td class="td-inner">数量</td>
                                </div>
                                <div class="th th-operation">
                                    <td class="td-inner">商品操作</td>
                                </div>
                                <div class="th th-amount">
                                    <td class="td-inner">合计</td>
                                </div>
                                <div class="th th-status">
                                    <td class="td-inner">交易状态</td>
                                </div>
                                <div class="th th-change">
                                    <td class="td-inner">交易操作</td>
                                </div>
                            </div>

                            <div class="order-main">
                                <div class="order-list" v-for="orders in orderList">
                                    <div class="order-status1">
                                        <div class="order-title">
                                            <div class="dd-num">订单编号：<a href="javascript:;">{{orders.id}}</a></div>
                                            <span>成交时间：{{orders.createDate | formatDate}}</span>
                                        </div>
                                        <div class="order-content">
                                            <div class="order-left">
                                                <ul class="item-list" v-for="goods in orders.goodsList">
                                                    <li class="td td-item">
                                                        <div class="item-pic">
                                                            <a href="#" class="J_MakePoint">
                                                                <img :src="goods.imgUrl" class="itempic J_ItemImg">
                                                            </a>
                                                        </div>
                                                        <div class="item-info">
                                                            <div class="item-basic-info">
                                                                <a href="#">
                                                                    <p>{{goods.goodsName}}</p>
                                                                </a>
                                                            </div>
                                                        </div>
                                                    </li>
                                                    <li class="td td-price">
                                                        <div class="item-price">
                                                            ￥{{goods.price}}
                                                        </div>
                                                    </li>
                                                    <li class="td td-number">
                                                        <div class="item-number">
                                                            <span>×</span>{{goods.goodsNumber}}
                                                        </div>
                                                    </li>
                                                    <li class="td td-operation">
                                                        <div class="item-operation">

                                                        </div>
                                                    </li>
                                                </ul>
                                            </div>
                                            <div class="order-right">
                                                <li class="td td-amount">
                                                    <div class="item-amount">
                                                        {{orders.orderPrice | showPrice}}
                                                    </div>
                                                </li>
                                                <div class="move-right">
                                                    <li class="td td-status">
                                                        <div class="item-status">
                                                            <strong>{{orders.status | showStatus}}</strong>
                                                            <p class="order-info" @click="cancellation(orders.id)"><a href="#">取消订单</a></p>
                                                        </div>
                                                    </li>
                                                    <li class="td td-change">
                                                        <!--																<a href="http://localhost:8080//shop-api/alipayTest.jsp">-->
                                                        <!--																</a>-->
                                                        <div class="am-btn am-btn-danger anniu"
                                                             @click="pay(orders.id,orders.orderPrice)">
                                                            一键支付
                                                        </div>
                                                    </li>
                                                </div>
                                            </div>

                                        </div>
                                    </div>
                                </div>

                            </div>
                        </div>
                        <div class="am-tab-panel am-fade" id="tab3">
                            <div class="order-top">
                                <div class="th th-item">
                                    <td class="td-inner">商品</td>
                                </div>
                                <div class="th th-price">
                                    <td class="td-inner">单价</td>
                                </div>
                                <div class="th th-number">
                                    <td class="td-inner">数量</td>
                                </div>
                                <div class="th th-operation">
                                    <td class="td-inner">商品操作</td>
                                </div>
                                <div class="th th-amount">
                                    <td class="td-inner">合计</td>
                                </div>
                                <div class="th th-status">
                                    <td class="td-inner">交易状态</td>
                                </div>
                                <div class="th th-change">
                                    <td class="td-inner">交易操作</td>
                                </div>
                            </div>

                            <div class="order-main">
                                <div class="order-list" v-for="orders in orderList">
                                    <div class="order-status2">
                                        <div class="order-title">
                                            <div class="dd-num">订单编号：<a href="javascript:;">{{orders.id}}</a></div>
                                            <span>成交时间：{{orders.createDate | formatDate}}</span>
                                        </div>
                                        <div class="order-content">
                                            <div class="order-left">
                                                <ul class="item-list" v-for="goods in orders.goodsList">
                                                    <li class="td td-item">
                                                        <div class="item-pic">
                                                            <a href="#" class="J_MakePoint">
                                                                <img :src="goods.imgUrl" class="itempic J_ItemImg">
                                                            </a>
                                                        </div>
                                                        <div class="item-info">
                                                            <div class="item-basic-info">
                                                                <a href="#">
                                                                    <p>{{goods.goodsName}}</p>
                                                                </a>
                                                            </div>
                                                        </div>
                                                    </li>
                                                    <li class="td td-price">
                                                        <div class="item-price">
                                                            ￥{{goods.price}}
                                                        </div>
                                                    </li>
                                                    <li class="td td-number">
                                                        <div class="item-number">
                                                            <span>×</span>{{goods.goodsNumber}}
                                                        </div>
                                                    </li>
<!--                                                    <li class="td td-operation">-->
<!--                                                        <div class="item-operation"-->
<!--                                                             @click="TradeRefund(orders.id,orders.orderPrice)">-->
<!--                                                            退款1-->
<!--                                                        </div>-->
<!--                                                    </li>-->
                                                </ul>
                                            </div>
                                            <div class="order-right">
                                                <li class="td td-amount">
                                                    <div class="item-amount">
                                                        {{orders.orderPrice | showPrice}}
                                                        <!--																<p>含运费：<span>10.00</span></p>-->
                                                    </div>
                                                </li>
                                                <div class="move-right">
                                                    <li class="td td-status">
                                                        <div class="item-status">
                                                            <p class="Mystatus">{{orders.status | showStatus}}</p>
                                                            <div class="item-operation"
                                                                 @click="TradeRefund(orders.id,orders.orderPrice)">
                                                                退款
                                                            </div>
                                                            <!--																	<p class="order-info"><a href="orderinfo.html">订单详情</a></p>-->
                                                        </div>
                                                    </li>
                                                    <li class="td td-change">
                                                        <div class="am-btn am-btn-danger anniu">
                                                            提醒发货
                                                        </div>
                                                    </li>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="am-tab-panel am-fade" id="tab4">
                            <div class="order-top">
                                <div class="th th-item">
                                    <td class="td-inner">商品</td>
                                </div>
                                <div class="th th-price">
                                    <td class="td-inner">单价</td>
                                </div>
                                <div class="th th-number">
                                    <td class="td-inner">数量</td>
                                </div>
                                <div class="th th-operation">
                                    <td class="td-inner">商品操作</td>
                                </div>
                                <div class="th th-amount">
                                    <td class="td-inner">合计</td>
                                </div>
                                <div class="th th-status">
                                    <td class="td-inner">交易状态</td>
                                </div>
                                <div class="th th-change">
                                    <td class="td-inner">交易操作</td>
                                </div>
                            </div>

                            <div class="order-main">
                                <div class="order-list" v-for="orders in orderList">
                                    <div class="order-status3">
                                        <div class="order-title">
                                            <div class="dd-num">订单编号：<a href="javascript:;">{{orders.id}}</a></div>
                                            <span>成交时间：{{orders.createDate | formatDate}}</span>
                                        </div>
                                        <div class="order-content">
                                            <div class="order-left">
                                                <ul class="item-list" v-for="goods in orders.goodsList">
                                                    <li class="td td-item">
                                                        <div class="item-pic">
                                                            <a href="#" class="J_MakePoint">
                                                                <img :src="goods.imgUrl" class="itempic J_ItemImg">
                                                            </a>
                                                        </div>
                                                        <div class="item-info">
                                                            <div class="item-basic-info">
                                                                <a href="#">
                                                                    <p>{{goods.goodsName}}</p>
                                                                </a>
                                                            </div>
                                                        </div>
                                                    </li>
                                                    <li class="td td-price">
                                                        <div class="item-price">
                                                            ￥{{goods.price}}
                                                        </div>
                                                    </li>
                                                    <li class="td td-number">
                                                        <div class="item-number">
                                                            <span>×</span>{{goods.goodsNumber}}
                                                        </div>
                                                    </li>
<!--                                                    <li class="td td-operation">-->
<!--                                                        <div class="item-operation">-->
<!--                                                            <a href="refund.html">退款</a>-->
<!--                                                        </div>-->
<!--                                                    </li>-->
                                                </ul>

                                            </div>
                                            <div class="order-right">
                                                <li class="td td-amount">
                                                    <div class="item-amount">
                                                        {{orders.orderPrice | showPrice}}
                                                        <!--																<p>含运费：<span>10.00</span></p>-->
                                                    </div>
                                                </li>
                                                <div class="move-right">
                                                    <li class="td td-status">
                                                        <p class="Mystatus">{{orders.status | showStatus}}</p>
                                                        <div class="item-operation"
                                                             @click="TradeRefund(orders.id,orders.orderPrice)">
                                                            退款
                                                        </div>
                                                        <!--																<div class="item-status">-->

                                                        <!--																	<p class="order-info"><a href="orderinfo.html">订单详情</a></p>-->
                                                        <!--																	<p class="order-info"><a href="logistics.html">查看物流</a></p>-->
                                                        <!--																	<p class="order-info"><a href="#">延长收货</a></p>-->
                                                        <!--																</div>-->
                                                    </li>
                                                    <li class="td td-change">
                                                        <div class="am-btn am-btn-danger anniu" @click="confirmReceipt(orders.id)">
                                                            确认收货
                                                        </div>
                                                    </li>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>

                        <div class="am-tab-panel am-fade" id="tab5">
                            <div class="order-top">
                                <div class="th th-item">
                                    <td class="td-inner">商品</td>
                                </div>
                                <div class="th th-price">
                                    <td class="td-inner">单价</td>
                                </div>
                                <div class="th th-number">
                                    <td class="td-inner">数量</td>
                                </div>
                                <div class="th th-operation">
                                    <td class="td-inner">商品操作</td>
                                </div>
                                <div class="th th-amount">
                                    <td class="td-inner">合计</td>
                                </div>
                                <div class="th th-status">
                                    <td class="td-inner">交易状态</td>
                                </div>
                                <div class="th th-change">
                                    <td class="td-inner">交易操作</td>
                                </div>
                            </div>

                            <div class="order-main">
                                <div class="order-list" v-for="orders in orderList">
                                    <!--不同状态的订单	-->
                                    <div class="order-status4">
                                        <div class="order-title">
                                            <div class="dd-num">订单编号：<a href="javascript:;">{{orders.id}}</a></div>
                                            <span>成交时间：{{orders.createDate | formatDate}}</span>

                                        </div>
                                        <div class="order-content">
                                            <div class="order-left">
                                                <ul class="item-list" v-for="goods in orders.goodsList">
                                                    <li class="td td-item">
                                                        <div class="item-pic">
                                                            <a href="#" class="J_MakePoint">
                                                                <img :src="goods.imgUrl" class="itempic J_ItemImg">
                                                            </a>
                                                        </div>
                                                        <div class="item-info">
                                                            <div class="item-basic-info">
                                                                <a href="#">
                                                                    <p>{{goods.goodsName}}</p>
                                                                </a>
                                                            </div>
                                                        </div>
                                                    </li>
                                                    <li class="td td-price">
                                                        <div class="item-price">
                                                            ￥{{goods.price}}
                                                        </div>
                                                    </li>
                                                    <li class="td td-number">
                                                        <div class="item-number">
                                                            <span>×</span>{{goods.goodsNumber}}
                                                        </div>
                                                    </li>
<!--                                                    <li class="td td-operation">-->
<!--                                                        <div class="item-operation">-->
<!--                                                            <a>退款2222</a>-->
<!--                                                        </div>-->
<!--                                                    </li>-->
                                                </ul>

                                            </div>
                                            <div class="order-right">
                                                <li class="td td-amount">
                                                    <div class="item-amount">
                                                        {{orders.orderPrice | showPrice}}
                                                        <!--																<p>含运费：<span>10.00</span></p>-->
                                                    </div>
                                                </li>
                                                <div class="move-right">
                                                    <li class="td td-status">
                                                        <div class="item-status">
                                                            <p class="Mystatus">{{orders.status | showStatus}}</p>
                                                            <!--																	<p class="order-info"><a href="orderinfo.html">订单详情</a></p>-->
                                                            <!--																	<p class="order-info"><a href="logistics.html">查看物流</a></p>-->
                                                        </div>
                                                    </li>
                                                    <li class="td td-change">
                                                        <a href="commentlist.html">
                                                            <div class="am-btn am-btn-danger anniu">
                                                                评价商品
                                                            </div>
                                                        </a>
                                                    </li>
                                                </div>
                                            </div>
                                        </div>
                                    </div>

                                </div>

                            </div>

                        </div>
                    </div>

                </div>
            </div>
        </div>
        <!--底部-->
        <div class="footer">
            <div class="footer-hd">
                <p>
                    <b>|</b>
                    <a href="# ">商城首页</a>
                    <b>|</b>
                    <a href="# ">支付宝</a>
                    <b>|</b>
                    <a href="# ">物流</a>
                </p>
            </div>
            <div class="footer-bd ">
                <p>
                    <a href="# ">合作伙伴</a>
                    <a href="# ">联系我们</a>
                    <a href="# ">网站地图</a>
                </p>
            </div>

        </div>
    </div>
    <aside class="menu">
        <ul>
            <li class="person active">
                <a href="index.html"><i class="am-icon-user"></i>个人中心</a>
            </li>
            <li class="person">
                <p><i class="am-icon-newspaper-o"></i>个人资料</p>
                <ul>
                    <li><a href="information.html">个人信息</a></li>
                    <li><a href="safety.html">安全设置</a></li>
                    <li><a href="address.html">地址管理</a></li>
                    <li><a href="cardlist.html">快捷支付</a></li>
                </ul>
            </li>
            <li class="person">
                <p><i class="am-icon-balance-scale"></i>我的交易</p>
                <ul>
                    <li><a href="order.html">订单管理</a></li>
                    <li><a href="change.html">退款售后</a></li>
                    <li><a href="comment.html">评价商品</a></li>
                </ul>
            </li>
            <li class="person">
                <p><i class="am-icon-dollar"></i>我的资产</p>
                <ul>
                    <li><a href="points.html">我的积分</a></li>
                    <li><a href="coupon.html">优惠券 </a></li>
                    <li><a href="bonus.html">红包</a></li>
                    <li><a href="walletlist.html">账户余额</a></li>
                    <li><a href="bill.html">账单明细</a></li>
                </ul>
            </li>

            <li class="person">
                <p><i class="am-icon-tags"></i>我的收藏</p>
                <ul>
                    <li><a href="collection.html">收藏</a></li>
                    <li><a href="foot.html">足迹</a></li>
                </ul>
            </li>

            <li class="person">
                <p><i class="am-icon-qq"></i>在线客服</p>
                <ul>
                    <li><a href="consultation.html">商品咨询</a></li>
                    <li><a href="suggest.html">意见反馈</a></li>

                    <li><a href="news.html">我的消息</a></li>
                </ul>
            </li>
        </ul>

    </aside>
</div>

</body>
</html>
<script>


    const vue = new Vue({
        el: '#div_vue',
        data: {
            orderList: [],
            userId:sessionStorage.id,

        },
        filters: {
            //价格
            showPrice(price) {
                return '￥' + price.toFixed(2)
            },
            //订单状态
            showStatus(status) {
                switch (status) {
                    case 1:
                        return "待支付"
                    case 2:
                        return "待发货"
                    case 3:
                        return "待收货"
                    case 4:
                        return "待评价"
                    case 5:
                        return "已完成"
                    case 6:
                        return "已取消"
                    case 7:
                        return "已退款"
                    case 8:
                        return "申请取消中"
                    case 9:
                        return "申请退款中"
                }
            },
            //时间格式化
            formatDate(value) {
                if (value != null) {
                    let date = new Date(value);
                    let y = date.getFullYear();
                    let MM = date.getMonth() + 1;
                    MM = MM < 10 ? ('0' + MM) : MM;
                    let d = date.getDate();
                    d = d < 10 ? ('0' + d) : d;
                    let h = date.getHours();
                    h = h < 10 ? ('0' + h) : h;
                    let m = date.getMinutes();
                    m = m < 10 ? ('0' + m) : m;
                    let s = date.getSeconds();
                    s = s < 10 ? ('0' + s) : s;
                    return y + '-' + MM + '-' + d + ' ' + h + ':' + m + ':' + s;
                } else {
                    return null
                }
            }
        },

        methods: {
            displayList: function () {
                let thisObj = this;
                let url = "order/mount";
                let params = {userId:this.userId};
                postWithParams(url, params, function (data) {
                    console.log(data);
                    thisObj.orderList = data;
                });
            },

            // 根据状态值与用户id查询订单
            payment: function (e) {
                let thisObj = this;
                // thisObj.e = e;
                let url = "order/state";
                let params = {status: e, userId:this.userId};
                postWithParams(url, params, function (data) {
                    console.log(data);
                    thisObj.orderList = data;
                });
            },

            pay: function (id, price) {
                let url = "http://localhost:8080/shop-api/alipayTradePagePay";
                let overview = "购买商品";
                let widDody = "";
                let params = {WIDout_trade_no: id, WIDtotal_amount: price, WIDsubject: overview, WIDbody: widDody};
                $.ajax({
                    type: "post",
                    url: url,
                    data: params,
                    success: function (resp) {
                        window["data"] = resp;
                        window.open("http://localhost:8080/view-api/alipay.html");
                    }
                });
            },

            TradeRefund: function (orderId, price) {
                let thisObj = this;
                let url = "";
                let NULL = "";
                let reason = "无条件退款"
                let params = {
                    WIDTRout_trade_no: orderId,
                    WIDTRtrade_no: NULL,
                    WIDTRrefund_amount: price,
                    WIDTRrefund_reason: reason,
                    WIDTRout_request_no: NULL
                }

                console.log(url)

                $.ajax({
                    type: "post",
                    url: "http://localhost:8080/shop-api/alipayTradeRefund",
                    data: params,
                    success: function (resp) {
                        alert("退款成功")
                        document.getElementById("LiNum02").click()
                    },
                    error:function () {
                        alert("超时，请刷新页面")
                    }

                });
            },

            cancellation:function (Id) {
                let url = "order/cancellation";
                let param = {orderId:Id};
                postWithParams(url,param,function () {
                    // console.log("申请取消订单中。。。")
                    alert("申请取消订单中。。。")
                    document.getElementById("LiNum01").click()
                })
            },
            //删除符合要求订单
            deleteOrder:function(orderId,state){
                let url = "order/deleteOrder";
                let param ={orderId:orderId};
                if (state === 5 || state === 6 || state === 7 ){
                    postWithParams(url,param,function () {
                        alert("订单已被删除")
                        document.getElementById("LiNum00").click()
                    })
                }else {
                    alert("该订单不能被删除")
                    document.getElementById("LiNum00").click()
                }
            },

            //确认收货
            confirmReceipt:function(Id){
                let url="order/confirmReceipt";
                let param={orderId:Id};
                postWithParams(url,param,function () {
                    alert("确认收货成功");
                    document.getElementById("LiNum03").click()
                })
            },
        },


        mounted: function () {
            this.displayList();
        }
    });
</script>